<?php
require_once("settings.php");
$args = explode('/', $_GET["q"]);

User::GetUser();
$page_name = "home";
if ($args[0] != "" && file_exists("page/" . $args[0] . ".php"))
  $page_name = $args[0];
include("page/" . $page_name . ".php");

if ($content=="")
  $content .= Template::Render("$page_name", get_defined_vars());
echo Template::Render("layout", get_defined_vars());

?>